Skip to content

fix: show error messages when API exceptions occur in s12-s20#362

Merged
Bill-Billion merged 1 commit into
shareAI-lab:mainfrom
Panda-eyes123:fix
Jun 26, 2026
Merged

fix: show error messages when API exceptions occur in s12-s20#362
Bill-Billion merged 1 commit into
shareAI-lab:mainfrom
Panda-eyes123:fix

Conversation

@Panda-eyes123

Copy link
Copy Markdown
Contributor
  1. Fixed silent error swallowing in s12-s20's agent loops.
  2. The bug: when API throws an exception, the except block stores it as a plain dict in messages, but the final display loop uses getattr(block, "type", None) which returns None for dicts (not objects), so the error message is never printed.The current state is "it runs but errors are invisible", which is the worst possible state.
  3. s14 already had the fix, s20 used the existing block_type() helper.
  4. Following the style of s14, fixed by adding '' elif isinstance(block, dict) and block.get("type") == "text": print(block.get("text", "")) '' to s12, s13, s15-s19, and using block_type() in s20.

@vercel

vercel Bot commented Jun 14, 2026

Copy link
Copy Markdown

@Panda-eyes123 is attempting to deploy a commit to the crazyboym's projects Team on Vercel.

A member of the Team first needs to authorize it.

@Bill-Billion

Copy link
Copy Markdown
Collaborator

Thanks for this, it is a clean catch. Confirmed in s12: the error is stored as a dict block, but the display loop only handled SDK objects via getattr(block, "type", None), so it got swallowed; your fix matches s14 and brings the other chapters in line. Minimal, reuses block_type in s20, and the loop is not in any README so no doc sync.

@Bill-Billion Bill-Billion merged commit 4545a38 into shareAI-lab:main Jun 26, 2026
0 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants